﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ControlKhaiBaoTTPP.ascx.cs" Inherits="WebUserControl_ControlKhaiBaoTTPP" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<%@ Register src="uscMsgBox.ascx" tagname="uscMsgBox" tagprefix="uc1" %>
<link rel="stylesheet" href='<%=ResolveUrl("~/LayoutCss/K_BaoCaoFormLayout.css")%>' type="text/css" />
<script type="text/javascript"  src='<%=ResolveUrl("~/Scripts/jquery.alphanumeric.js")%>'></script>

<script type="text/javascript">
     function pageLoad() {
      $("#<%= txtDienThoai.ClientID %>").numeric();
      
       $("#<%= btnSave.ClientID %>").click(function() {
           if ($("#<%= txtMaTTPP.ClientID %>").val().length > 0 && $("#<%= txtTenTTPP.ClientID %>").val().length > 0 && $("#<%= txtSAP.ClientID %>").val().length > 0)
        {
        $.blockUI({
             message: '<h1>Xin vui lòng chờ xử lý</h1>', 
            css: { 
            border: 'none', 
            padding: '15px', 
            backgroundColor: '#f00', 
            opacity: .5, 
            color: '#fff' 
        } });
        } 
        }); 
        
      $("#<%= btnNew.ClientID %>").click(function() { 
        $.blockUI({
             message: '<h1>Xin vui lòng chờ xử lý</h1>', 
            css: { 
            border: 'none', 
            padding: '15px', 
            backgroundColor: '#f00', 
            opacity: .5, 
            color: '#fff' 
        } }); 
        });
$("#<%= ImgTimKiem.ClientID %>").click(function () {
    $.blockUI({
        message: '<h1>Xin vui lòng chờ xử lý</h1>',
        css: {
            border: 'none',
            padding: '15px',
            backgroundColor: '#f00',
            opacity: .5,
            color: '#fff'
        }
    });
});
$("#<%= btFind.ClientID %>").click(function () {
    $.blockUI({
        message: '<h1>Xin vui lòng chờ xử lý</h1>',
        css: {
            border: 'none',
            padding: '15px',
            backgroundColor: '#f00',
            opacity: .5,
            color: '#fff'
        }
    });
}); 
         Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);
                function EndRequestHandler(sender, args) {
                        $.unblockUI();
                }
     }
</script>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <ContentTemplate>
        <fieldset>
                <legend>Khai báo trung tâm phân phối</legend>
        </fieldset>
        <asp:Panel ID="Panel1" runat="server" BackColor="#EBEBEB" Width="100%">
                    <asp:ImageButton ID="btnNew" runat="server" ToolTip="Tạo mới" CausesValidation="false"
                        ImageUrl="~/image/Document.png" onclick="btnNew_Click" 
                        Height="25px" Width="25px" />
                    &nbsp;<asp:ImageButton ID="btnSave" runat="server" ToolTip="Lưu"
                        ImageUrl="~/image/Save.png" onclick="btnSave_Click" 
                        Height="25px" Width="25px" />
                    &nbsp;<asp:ImageButton ToolTip="Tìm kiếm" ID="ImgTimKiem" runat="server" CausesValidation="false" 
                            Height="25px" Width="25px"  ImageUrl="~/image/Find.png" 
                            onclick="ImgTimKiem_Click" />               
                    </asp:Panel> 
          <br />
          <cc1:TabContainer ID="TabContainer1" runat="server" ActiveTabIndex="0" 
            BackColor="#CCFFFF" Font-Names="Arial"  Height="300px" 
            Width="100%">
            <cc1:TabPanel ID="TabPanel1" runat="server" HeaderText="Nhập thông tin" TabIndex="0">
                <ContentTemplate>
                   <fieldset>
                    <legend>Thông tin TTPP</legend>
                    <div class="fm-req">
                       <label for="txtMaTuVanVien">Mã TTPP:</label>
                        <asp:TextBox ID="txtMaTTPP" Width="150px" BackColor="Yellow" runat="server"></asp:TextBox>
                        <asp:RequiredFieldValidator ControlToValidate="txtMaTTPP" Display="None"  ID="RequiredFieldValidator2" runat="server" ErrorMessage="Phải nhập mã TTPP">
                                </asp:RequiredFieldValidator>
                                <cc1:ValidatorCalloutExtender TargetControlID="RequiredFieldValidator2" ID="ValidatorCalloutExtender2" runat="server">
                                </cc1:ValidatorCalloutExtender>
                   </div>
                   <div class="fm-req">
                       <label for="txtMaTuVanVien">Tên TTPP:</label>
                        <asp:TextBox ID="txtTenTTPP" runat="server" Width="200px"></asp:TextBox>
                        <asp:RequiredFieldValidator ControlToValidate="txtTenTTPP" Display="None"  ID="RequiredFieldValidator1" runat="server" ErrorMessage="Phải nhập tên TTPP">
                                </asp:RequiredFieldValidator>
                                <cc1:ValidatorCalloutExtender TargetControlID="RequiredFieldValidator1" ID="ValidatorCalloutExtender1" runat="server">
                                </cc1:ValidatorCalloutExtender>
                   </div>
                   <div class="fm-req">
                       <label for="txtMaTuVanVien">Mã SAP:</label>
                        <asp:TextBox ID="txtSAP" runat="server" Width="200px"></asp:TextBox>
                        <asp:RequiredFieldValidator ControlToValidate="txtSAP" Display="None"  ID="RequiredFieldValidator3" runat="server" ErrorMessage="Phải nhập mã SAP">
                                </asp:RequiredFieldValidator>
                                <cc1:ValidatorCalloutExtender TargetControlID="RequiredFieldValidator3" ID="ValidatorCalloutExtender3" runat="server">
                                </cc1:ValidatorCalloutExtender>
                    </div>
                    <div class="fm-req">
                       <label for="CheckConBanHang">Đang hoạt động :</label>
                    <asp:CheckBox ID="CheckActive" runat="server" />
                    </div>
                     <div class="fm-req">
                       <label for="CheckConBanHang">Show Room :</label>
                    <asp:CheckBox ID="CheckShowRoom" runat="server" Checked="True" />
                    </div>
                   <div class="fm-re">
                       <label for="txtMaTuVanVien">Địa chỉ:</label>
                        <asp:TextBox ID="txtDiaChi" runat="server" Width="350px"></asp:TextBox>
                   </div>
                   <div class="fm-re">
                       <label for="txtMaTuVanVien">Số điện thoại:</label>
                        <asp:TextBox ID="txtDienThoai" runat="server" Width="200px"></asp:TextBox>
                   </div>
                    </fieldset>
                 </ContentTemplate>
           </cc1:TabPanel>
           <cc1:TabPanel ID="TabPanel2" runat="server" HeaderText="Tìm kiếm" TabIndex="1">
                <ContentTemplate>
                <fieldset>
                    <legend>Tìm kiếm TTPP</legend>
                     <div class="fm-req">
                    <label for="txtNgheNghiep">Nhập thông tin cần tìm:</label> 
                        <asp:TextBox ID="txtSearch" runat="server" CausesValidation="false" Width="200px"></asp:TextBox>
                       <asp:Button ID="btFind" runat="server" Width="100px" Text="Tìm kiếm" CausesValidation="false" 
                            onclick="btFind_Click" />
                   </div> 
                          <br />     
                                <asp:GridView ID="GridView2" runat="server" AllowPaging="True" 
                                    AutoGenerateColumns="False" BackColor="#DEBA84" BorderColor="#DEBA84" 
                                    BorderStyle="None" BorderWidth="1px" CellPadding="3" CellSpacing="2" 
                                    DataKeyNames="sitecode"  onpageindexchanging="GridView2_PageIndexChanging"  
                                    OnRowCommand="GridView2_RowCommand" PageSize="5" Width="306px">
                                    <Columns>
                                        <asp:BoundField DataField="sitecode" HeaderText="Mã TTPP" />
                                        <asp:BoundField DataField="sitename" HeaderText="Tên TTPP" />
                                        <asp:TemplateField>
                                            <ItemTemplate>
                                             <asp:ImageButton ID="ImageButton4" runat="server" CausesValidation="False" CommandName="chon" Height="20px" ImageUrl="~/image/Symbol-Check.png" Width="20px" />
                                         </ItemTemplate>
                                            <FooterStyle BackColor="White" BorderColor="White" />
                                            <HeaderStyle BackColor="White" BorderColor="White" />
                                            <ItemStyle BackColor="White" BorderColor="White" />
                                        </asp:TemplateField>
                                    </Columns>
                                    <FooterStyle BackColor="#F7DFB5" ForeColor="#8C4510" />
                                    <HeaderStyle BackColor="#A55129" Font-Bold="True" ForeColor="White" />
                                    <PagerStyle ForeColor="#8C4510" HorizontalAlign="Center" />
                                    <RowStyle BackColor="#FFF7E7" ForeColor="#8C4510" />
                                    <SelectedRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="White" />
                                </asp:GridView>  
                 </fieldset>
                 </ContentTemplate>
             </cc1:TabPanel>
        </cc1:TabContainer> 
    </ContentTemplate>
</asp:UpdatePanel>
<uc1:uscMsgBox ID="uscMsgBox1" runat="server" />

